Medical arrangements and a method for determining parameters related to insulin therapy, predicting glucose values and for providing insulin dosing recommendations

ABSTRACT

The present invention relates to a method for determining a personalized estimate, the magnitude of an intended medical effect, a duration and a shape of this, for a drug, based on sections of data where a target biomarker and dose history have been recorded, wherein the personalized estimate of a finite impulse response model a=[a0, a2 . . . an] and the basal hepatic glucose production Gb is determined according to equations of the present invention. The present invention further relates to a system for controlling insulin delivery to a patient according to the method described in the present invention where the measured biomarker is glucose. The present invention further relates to a medical device performing the calculations according to the present invention.

FIELD OF THE INVENTION

The present invention relates in general to insulin therapy and to the determining of patient-specific physiological and pharmacokinetic parameters related to the glucose-lowering effect of insulin from data collected from the individual, and how to utilize these parameters to improve the insulin therapy outcome.

TECHNICAL BACKGROUND

Globally, 300 to 400 million people have developed diabetes. In 2035 the number is expected to be closer to 600 million. About 5-10% of the diabetic population have type I diabetes and require intensive insulin treatment, and a majority with type II diabetes also require insulin 6-10 years post diagnosis. Modern insulin therapy consists of multiple daily injections using an insulin pen (MDI) or by means of continuous infusion by an insulin pump (CSII). To assess the glucose level personal glucose meters (SMBG), providing a reading of the plasma glucose level at the time of measurement, as well as the evolving continuous glucose measurement systems (CGM), which give frequent measurements (typically every 5 minutes) of the glucose level in the subcutaneous tissue where the sensor is placed, are used. Poor glycemic control due to excessive or insufficient insulin doses may result in both short-term and long-term complications, such as, e.g., acute seizures and coma due to hypoglycemia (low blood glucose concentration) or, e.g., chronic renal disease, blindness and micro- and macrovascular diseases due to long-term hyperglycemia (high blood glucose concentration).

Generally, the diabetes population has unsatisfying glycemic levels and there is a large demand for means to improved control. To optimize the insulin therapy for each individual, knowledge of the glucose-lowering effect and the specific dose requirements are essential. However, current practice and technology do not provide means to effectively and reliably determining these factors on an individual basis.

SUMMARY OF THE INVENTION

In one aspect the present invention provides a method for determining a personalized estimate, the magnitude of an intended medical effect, a duration and a shape of this, for a drug, based on sections of data where a target biomarker and dose history have been recorded, wherein the personalized estimate of a finite impulse response model a=[a₀, a₂ . . . a_(n)] and the basal hepatic glucose production G_(b) is determined according to:

$\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},{t_{k} \in T_{j}}} & (1) \end{matrix}$

I(t_(k)) represents a drug infusion and y(t_(k))^((j)) is a biomarker level at a time sample t_(k), v(t_(k))˜N(0, σ_(v)) corresponds to a process noise perturbation with variance σ_(v) ², and T_(j) represents the time instances in a dataset j, and where impulse-response model parameters a=[a₀, a₁ . . . a_(n)] have a biomarker dependence; for each biomarker level G of interest, the following problem is solved to retrieve the parameter estimates; a and G_(b)=[G_(b) ⁽¹⁾ . . . G_(b) ^((N))] using N periods of data:

$\begin{matrix} {\left\{ {{a(G)},G_{b}} \right\} = {{\arg \; \min {\sum\limits_{j = 1}^{N}\left( {{{}y^{(j)}} - {{\hat{y}}^{(j)}{}_{W^{G}}} + {\alpha {a}_{R}} + {\beta {{G_{b}^{(j)} - G_{b}^{0}}}_{2}}} \right)}} + {\gamma {a}_{1}}}} & (2) \end{matrix}$

subject to

a _(k)≤0, k=[1, . . . ,n−1]

a ₀=0

a _(n)=0  (3)

and wherein a second-order regularization matrix R is populated as follows:

R(j,j−1:j+1)=[1−21], j=[1, . . . ,n]  (4)

wherein y^((j))=[y_(t) _(l) _(j) . . . y_(t) _(n) _(j) ] is the collected biomarker data for data record j covering sample times T_(j)=[t_(l) ^(j) . . . t_(n) ^(j)], and ŷ^((j))=[ŷ_(t) _(l) _(j) . . . ŷ_(t) _(n) _(j) ] is the corresponding estimate of biomarker level according to the equation (1); W^(G) is the quadratic kernel matrix defining the weight of each biomarker measurement according to the distance to the biomarker level G; G_(b) ⁰ is the prior expected value estimate of G_(b), and α, β and γ are penalty terms.

In one embodiment the method further comprises a step of estimating a required dosage needed, during different time intervals, to achieve an intended effect of the drug on the biomarker.

In one embodiment the method comprises a step of calculating the sensitivity factor of the drug for different glucose values G by summing up all the a(G)=[a₀,(G) a₁ (G) . . . a_(n)(G)] terms given by the method according to the present invention.

In one embodiment the method comprises calculating an average sensitivity factor of the drug by averaging the sensitivity factors of the above.

In one embodiment the method comprises a step of calculating a drug dose based on the sensitivity factor, the shape and duration of the drug action, information about previous doses Dj at times Tj, the current biomarker level G and target biomarker level G_(t) according to:

$\begin{matrix} {{D = {\max \left( {0,\frac{G - G_{t} - {{\overset{\_}{K}}_{ISR} \cdot D_{IOB}}}{{\overset{\_}{K}}_{ISR}}} \right)}}{and}} & (8) \\ {{D_{IOB} = {\sum\limits_{j = 1}^{m}{D_{j}\left( {1 - \frac{\sum\limits_{i = 1}^{{({T - T_{j}})}/5}{\overset{\_}{a}}_{i}}{K_{ISR}}} \right)}}},{\forall{j:{T_{j} \leq {T - {5 \cdot n}}}}}} & (9) \end{matrix}$

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention together with information of the planned dosage and measurements of the biomarker, for calculating an expected effect for a time period covering p sample steps ahead according to:

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}|t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}|t_{k - 1}}} + {\alpha \; y_{t}}}}} & (10) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq p}} & (12) \end{matrix}$

where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, and α is the Kalman filter constant, and I(t_(k)) is the insulin dose at time t_(k); and to issue at least one alarm in an electronic device when predefined thresholds are broken.

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention and measurements of the biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to:

ŷ _(t) _(k) _(|t) _(k) =(1−α)ŷ _(t) _(k) _(|t) _(k−1) +αy _(t)  (10)

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq {p.}}} & (12) \end{matrix}$

where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, and I(t_(k)) is the insulin dose at time t_(k) and α is the Kalman filter constant.

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention and measurements of the biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to:

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}|t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}|t_{k - 1}}} + {\alpha \; y_{t}}}}} & (10) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq p}} & (12) \end{matrix}$

where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, I(t_(k)) is the insulin dose at time t_(k), and α is the Kalman filter constant; and for optimizing a therapy, where I_(S)=[I_(T) . . . I_(T+L)] is the suggested insulin dose at the time point of calculation (sample number T) and L(≤p) samples ahead according to:

$\begin{matrix} {\min\limits_{I_{s}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$

subject to

ŷ _(j)=γ_(low) , j=[T . . . T+L]  (14)

where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L]) ^(T) is the simulated biomarker trace calculated according to the equations (10)-(12), Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention with information about the planned dosage and measurements of the biomarker, for calculating an expected effect and for reprogramming planned doses in a drug delivery pump when predefined thresholds are broken, wherein the new reprogramming dose I_(S)=[I_(T) . . . I_(T+L)] at the time point of calculation (sample number T) and L(≤p) samples ahead is based on an optimization according to:

$\begin{matrix} {\min\limits_{I_{s}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$

subject to

ŷ _(j)≥γ_(low) , j=[T . . . T+L]  (14)

where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L)]^(T) is the simulated biomarker according to Eq (10-12) trace, Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).

One aspect of the present invention relates to a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized:

max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15)

and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to

$\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},} & (16) \\ {\mspace{79mu} {t_{k} \in T_{j}}} & \; \end{matrix}$

where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j;

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention together with information of the planned dosage and measurements of biomarker, for calculating the expected effect for a time period covering p sample steps ahead according to:

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}|t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}|t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},} & (20) \\ {\mspace{79mu} {1 \leq j \leq p}} & \; \end{matrix}$

and to issue at least one alarm in an electronic device when predefined thresholds are broken.

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention and measurements of biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to:

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}|t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}|t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},} & (20) \\ {\mspace{79mu} {1 \leq j \leq p}} & \; \end{matrix}$

In one embodiment the method comprises the steps of using the parameters estimated according to the present invention and recent measurements of biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to:

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}|t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}|t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}|t_{k}} = {{\hat{y}}_{t_{k}|t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}|t_{k + j}} = {{\hat{y}}_{t_{k + j}|t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}|t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},} & (20) \\ {\mspace{79mu} {1 \leq j \leq p}} & \; \end{matrix}$

and for optimizing a therapy I_(S)=[I_(T) . . . I_(T+L)] at the time point of calculation (sample number T) and L(≤p) samples ahead according to:

$\begin{matrix} {\min\limits_{I_{S}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$

subject to

ŷ _(j)≥γ_(low) , j=[T . . . T+L]  (14)

where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L)]^(T) the simulated biomarker according to Eq (10-12) trace, Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).

Another aspect of the present invention relates to a system for controlling insulin delivery to a patient according to the method described in the present invention where the measured biomarker is glucose.

In one embodiment the system may be comprising an insulin pump, a glucose meter, a receiver unit for a continuous glucose meter, a smartphone, a tablet, a computer or any other device that may have the capability to display information to a user and perform the necessary measurements and calculations.

Yet another aspect of the present invention relates to a medical device performing the calculations according to the present invention.

With the above description in mind, an aspect of some of the embodiments of this invention relates to determining parameters used to improve insulin therapy in insulin treated diabetes from collected data from an individual. Using these parameters, the glucose-lowering effect, from the time point of an insulin injection until it no longer can be detected, can be determined specifically for that individual. Additionally, the insulin required to maintain, or reach, a treatment target, such as achieving a predefined glucose level, can be calculated for a given time period. The estimates above can be used together with a measurement of the current glucose level, in a medical device or system, to predict the future glucose level and to issue alarms to the user when the predicted value at a certain time point ahead breaks thresholds, indicating potentially dangerous future low or high glucose values. In these devices or systems, different treatment scenarios can be simulated allowing the user to scrutinize and choose a suitable dosing regime. Specifically, in systems where the insulin dosing can be manipulated such as insulin pumps, the insulin delivery can be suspended based on these prediction, and a new insulin dose for the near future can be programmed to reduce the risk of developing dangerously low or high glucose values.

SHORT DESCRIPTION OF THE DRAWINGS

FIG. 1. Example of a section of collected glucose and insulin infusion data. The data in this example has been sampled with a five minute interval.

FIG. 2. Example of estimated insulin action across the glucose range.

FIG. 3. Example of estimated insulin requirements.

FIG. 4. Example of an estimated glucose independent insulin action curve.

FIG. 5. Summary of the steps in process to retrieve the parameter estimates.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the present invention will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Like reference signs refer to like elements throughout.

Embodiments of the present invention relate, in general, to the field of insulin therapy. By the term “insulin action” is meant the combined pharmacokinetic and pharmacodynamic metabolic glucose-lowering effect of a specific insulin type for a specific individual.

The pharmacokinetic and pharmacodynamics properties of different insulin types are based on generic assumptions derived from population results, and do not necessarily reflect any particular individual. Using these generic estimates may therefore deviate considerably when applied to a given individual, with potentially poor and dangerous treatment outcomes as result. To mitigate this situation, some additional heuristic rules-of-thumb have been derived. In terms of how to determine the total glucose-lowering effect—the insulin sensitivity factor (ISF)—different formulas exist, but the most widely used is the so-called the 100-rule (or 1800-rule if the mg/dl scale is used). This rule suggests that the ISF can be calculated by dividing 100 by the amount of the total daily insulin dose (TDD). Recently these rules were revised by the originators with slight adjustments to the 100-rule (one author suggests using 109 and the other to use 95). Again, this rule is generic and generally produces poor estimates, and many patients complement this rule by estimating the ISF from personal experience, e.g., from occasional correction boluses. In terms of determining the duration of the metabolic effect no existing method is available. For patients who look for guidance to healthcare professional organizations online often encounter quite short suggested duration of the insulin action, despite that numerous clamp studies suggest that the duration may be up to 8 hours. The American Diabetes Association (ADA) online patient information suggests that the rapid acting insulins peak in about an hour and that the total duration is 2-4 hours. National Institutes of Health (NIH) suggests a peak somewhere between 30 and 90 minutes and a total duration of 3 to 5 hours. Group HealthCare, a non-profit member-owned healthcare organization based in Seattle, suggests a peak at 90 minutes and a total duration of 3 hours. Joslin Diabetes Center advices 30 min-3 hour peak and a total duration of 3-5 hours. Similar information is provided by NovoNordisk; maximum effect in-between 1 and 3 hours and a total duration of 3-5 hours.

Apparently there is quite a spread in the suggested duration and this reflects the variability in the population, as different clamp studies have suggested. However, for the individual the insulin action duration as well as the shape thereof, are crucial parameters to determine. The shape determines the glucose-lowering effect for each time sample of the total duration from the time point of injection until the time point when the effect is no longer detectable. Mismatch between the expected duration and shape and the true effect and corresponding true shape may result in, e.g., stacking of doses and unexpected hypoglycemia.

The shape of the insulin action is equivalent to a functional description of the dynamic glucose-lowering effect over time of a subcutaneously administered injection of a predefined amount of insulin.

Many modern insulin pumps, as well as some glucose meters, offer decision support systems (DSS) for insulin therapy to the user in the form of so-called bolus guides. These calculators can be used to determine insulin doses based on the current glucose level, a treatment target, the insulin sensitivity factor and the amount of remaining insulin from previous injections. In these systems, the user may select the insulin sensitivity factor, e.g. by the rule presented above, as well as the duration of the insulin action.

The shape of the insulin action profile is sometimes linear, i.e., the glucose-lowering effect is considered constant over the active period, and in some cases a nonlinear curve is used to better reflect the glucose-lowering effect over the action period. As stressed above, neither the magnitude of the glucose-lowering effect nor the dynamics thereof are properly determined for each individual with the currently available methods, reducing the efficacy of these decision supports.

The present invention relates to determining patient-specific physiological and pharmacokinetic parameters related to the glucose-lowering effect of insulin from data collected from said individual, and how to utilize these parameters to improve the insulin therapy outcome. Specifically, the invention discloses a method of how to estimate the insulin sensitive factor for a given person and insulin type, as well as the duration and shape of the glucose-lowering effect. Furthermore, the method also provides an estimate of the insulin requirement for this person at different time instances or occasions. Using these calculated estimates together with recent glucose measurements for example in a computer or any other device with calculating capabilities, the future glucose level may be simulated hours in advance. Thus, the method may be used to warn the patient of impeding dangerous low or high glucose values, and different therapy adjustments may be simulated in advance. The description below is based upon that health related data have been collected from an individual treated with insulin and made available, preferably in a digital format. The health related data may cover one or more of: insulin injections of the different insulin types the individual uses, glucose readings from a personal glucose meter and/or continuous glucose sensor or from any other means to measure the capillary, venous or interstitial glucose level. All glucose readings will hereafter be referred to as simply ‘glucose’.

In an embodiment of the present invention, the insulin action can be estimated from a record including N different sections of combined insulin dose and glucose data from an individual. An example of collected data can be seen in FIG. 1. These data sections may represent different time frames, e.g. each section represents a specific time section of the day and the entire record covers such sections from couple of weeks or months of data.

A black-box Finite Impulse Response (FIR) model is considered to describe the insulin action, allowing for heterogeneous effects of the insulin action across the glucose range, i.e., higher or lower glucose-lowering effect depending on the current glucose level. However, the fasting glucose dynamics depends on internal dynamics, related to the hepatic glucose production and fasting metabolism, as well as the externally provided insulin. In this approach, this was summarized into a total net basal endogenous glucose production G_(b) in fasting state. In total, the glucose dynamics during fasting at time point t_(k) after may then be described as

$\begin{matrix} {{{y\left( t_{k\;} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\; {t_{k} \in T_{j}}} & (1) \end{matrix}$

where I(t_(k)) represents the insulin infusion and y(t_(k))^((j)) is the glucose level at time sample t_(k) in section j, v(t_(k))˜N(0, σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in data set j, and where the impulse-response model parameters a=[a₁, a₂ . . . a_(n)] have a glucose dependence. The sampling interval is generally five minutes, but other sampling schemes may also be considered. To estimate the model, e.g., locally-weighted least squares using a quadratic Epaneichnikov kernel or some other kernel may be employed.

In order to keep the estimate smooth, e.g., second-order regularization may also be considered, utilizing e.g. a Gaussian prior for G_(b). To reduce the model size, the parameters may be regularized by the 1-norm. To fulfill the physiological requirements of glucose-lowering response to insulin, the parameters are constrained to non-positive numbers, and the start and end of the insulin action are enforced to zero. For each glucose level G of interest, the following optimization problem is solved to retrieve the parameter estimates; a=[a₀, a₁ . . . a_(n)] and G_(b)=[G_(b) ⁽¹⁾ . . . G_(b) ^((N))] using N periods of data.

$\begin{matrix} {\left\{ {{a(G)},G_{b}} \right\} = {{\arg \; \min \; {\sum\limits_{j = 1}^{N}\left( {{{y^{(j)} - {\hat{y}}^{(j)}}}_{W^{G}} + {\alpha {a}_{R}} + {\beta {{G_{b}^{(j)} - G_{b}^{0}}}_{2}}} \right)}} + {\gamma {a}_{1}}}} & (2) \end{matrix}$

subject to

a _(k)≤0, k=[1, . . . ,n−1]

a ₀=0

a _(n)=0  (3)

and where the second-order regularization matrix R is populated as follows:

R(j,j−1:j+1)=[1−21], j=[1, . . . ,n]  (4)

Here, y^((j))=[y_(t) _(l) _(j) . . . y_(t) _(n) _(j) ] is the collected glucose data for data record j covering sample times T_(j)=[t_(l) ^(j) . . . t_(n) ^(j)], and ŷ^((j))=[ŷ_(t) _(l) _(j) . . . ŷ_(t) _(n) _(j) ] is the corresponding estimate according to Eq. (1). W^(G) is the quadratic kernel matrix defining the weight of each glucose measurement according to the distance to the glucose level G. G_(b) ⁰ is the prior expected value estimate of G_(b), and α, β and γ are penalty terms. An example of the insulin action can be seen in FIG. 2 and the G_(b) is exemplified in FIG. 3.

The total stationary glucose-lowering effect, the insulin sensitivity factor K_(ISR) at a given glucose level y_(b) is then:

$\begin{matrix} {{\sum\limits_{i = 1}^{n}{{a_{i}\left( y_{b} \right)} \cdot I_{b}}} = {K_{ISR}\left( y_{b} \right)}} & (5) \end{matrix}$

It is also possible to calculate the mean insulin sensitivity factor over the n_(G) different glucose values.

$\begin{matrix} {{\overset{\_}{K}}_{ISR} = {\sum\limits_{i = 1}^{n_{G}}\frac{K_{ISR}\left( y_{i} \right)}{n_{G}}}} & (6) \end{matrix}$

The mean value may be used as a useful approximation of the glucose-lowering effect independent of the glucose value. Likewise, the finite impulse response parameters may also be averaged over the glucose range to get a glucose independent insulin action curve.

$\begin{matrix} {{{\overset{\_}{a}}_{j} = {\sum\limits_{i = 1}^{n_{G}}\frac{a_{j}\left( y_{i} \right)}{n_{G}}}},\mspace{14mu} {j = \left\lbrack {1\mspace{14mu} \ldots \mspace{14mu} n} \right\rbrack}} & (7) \end{matrix}$

For an example se FIG. 4.

The estimation may be undertaken anew when new data has been collected, thereby assuring that the estimates are up to date. The frequency of re-estimation may vary depending on data availability, clinical practice, and personal conditions. The steps have been summarized in FIG. 5.

The estimates may be used for decision support for insulin bolus dose calculation for both insulin pump and insulin pen therapy. In a bolus calculator, the suggested bolus dose D at time T (rounded to closest 5 minute interval) needed to reach the glucose target G_(t), considering m previous doses D_(j) (j=1 . . . n) taken at time point T_(j) within the time frame of the insulin action is calculated as:

$\begin{matrix} {D = {\max \left( {0,\frac{G - G_{t} - {{\overset{\_}{K}}_{ISR} \cdot D_{IOB}}}{{\overset{\_}{K}}_{ISR}}} \right)}} & (8) \end{matrix}$

where D_(IOB) is the amount of active insulin remaining from the previous doses:

$\begin{matrix} {{D_{IOB} = {\sum\limits_{j = 1}^{m}{D_{j}\left( {1 - \frac{\sum\limits_{i = 1}^{{({T - T_{j}})}/5}{\overset{\_}{a}}_{i}}{K_{ISR}}} \right)}}},\mspace{14mu} {\forall{{j\text{:}T_{j}} \leq {T - {5 \cdot n}}}}} & (9) \end{matrix}$

The calculated values may be available in an insulin pump, a glucose meter, in a receiver unit for a continuous glucose meter, in smartphones, tablets, computers or other devices that may be used to display information to a user.

In an embodiment of the present invention the method described may be used to get estimates of G_(b), which describe the underlying basal insulin requirement. The estimates may reveal diurnal patterns, day-to-day variations and variations over longer trends. This information may prove useful in clinical practice to enable long-term trend analysis of the patient's health condition, understanding of drivers of glucose variability and barriers to achieving treatment targets, and ultimately a tool for evaluation of changes to the current therapy plan. Paired with monitoring of physical activity, correlation analysis may be undertaken to find causality connections between the level of physical activity and the effect on insulin requirement, thereby enabling preventive action to be undertaken, e.g. to temporarily reduce the insulin doses or reprogram the basal dose regime to avoid hypoglycemic events. These estimates may be made available in analysis software in a computer, smartphone, tablet or other devices that may be used to display information to a user.

In an embodiment of the present invention the method may also be used to assess the risk of developing hypo- or hyperglycemia in the near future. Considering the recent insulin dosage and glucose history, and a prior G_(b) ⁰, a posterior estimate of a scalar G_(b) for this time period is calculated by maximizing the likelihood p(G_(b)/Y,I,G_(b) ⁰), where Y=[y_(T−k) . . . y_(T)] is the recent glucose history at time T looking k sampling steps back, and I=[I_(T−k) . . . I_(T)] is the corresponding recent insulin usage history. Depending on the distribution of the prior, a closed form expression may exist for the estimate. Otherwise, e.g. sequential Monte Carlo methods may be applied. Then, assuming the patient will follow the planned basal regime and based on new glucose measurements y_(t), the expected glucose trace for the coming hours may be calculated by applying, e.g., a Kalman filter:

$\begin{matrix} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}} & (10) \\ {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},} & (12) \\ {1 \leq j \leq p} & \; \end{matrix}$

Where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, and α is the Kalman filter constant.

The normal glycemic range is defined by an upper and lower limit. If the simulated value falls outside these predefined thresholds, alarms are issued to notify the user of the impeding hypo- or hyperglycemia to allow for preventive actions to be taken. To guide the user, suggestions of suitable actions to mitigate the situation may also be provided. These suggestions may be based on reducing or increasing the basal insulin delivery (for insulin pump users) or reduced basal dose (for insulin pen users), and in the case of hyperglycemia of additional correction bolus doses I_(S)=[I_(T) . . . I_(T+L)], where I_(S) is the suggested insulin dose at the time point of calculation (sample number T) and L(≤p) samples ahead, according to the following optimization routine:

$\begin{matrix} {\min\limits_{I_{S}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$

Subject to

ŷ _(j)=γ_(low) , j=[T . . . T+L]  (14)

where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L)]^(T) is the simulated glucose trace, Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target glucose value y_(R), and where the constraint strictly enforces that no hypoglycemia may occur (hypoglycemic threshold γ_(low)). An example is found in FIG. 6. If no solution is found due to constraint violation (infeasible problem), the user is informed of this and no insulin dose suggestion is provided. Such a warning algorithm may be utilized in an insulin pump, a glucose meter, in a receiver unit for a continuous glucose meter, in smartphones, tablets, computers or other devices that may be used to display information to a user.

In yet another embodiment of the present invention the warning algorithm may be extended to not only deliver alarms, but also to allow for the user to simulate the effect of changes to the insulin therapy on the expected glucose trace for the coming hours by exchanging the insulin doses I with the new planned I_(new) in Eq (11) and (12). Thereby the user may assess the risk of different treatment scenarios at his/her own discretion.

In yet another embodiment of the present invention the estimated values may be used in an algorithm to reduce or shutoff insulin delivery in an insulin pump. When the predicted glucose value falls below the predefined hypoglycemic threshold with the current therapy plan as calculated by Eq. (10-12), the insulin delivery may be reduced or completely shut off as determined by performing an optimization according to Eq (13-14).

The method described above is not in any way limited to the use of insulin. Dose calculations for other drugs, self-medicated or not, may also benefit from this method to understand the dose response better and thereby enable better tailored doses to each individual. In these cases, the variable correspondences in the equations above are exchanged accordingly, as obvious to someone skilled in the art.

The present invention, as described by the different embodiments in conjunction with equations 1 to 14 above, may also be implemented in a system or device for controlling insulin delivery to a patient. Such a system or device may for instance be an insulin pump, a glucose meter, a receiver unit for a continuous glucose meter, a smartphone, a tablet, a computer or any other device that may have the capability to display information to a user and perform the necessary measurements and calculations described in conjunction with equations 1 to 14 in the above text. Many modern insulin pumps, as well as some glucose meters, offer decision support systems (DSS) for insulin therapy to the user in the form of so-called bolus guides. These calculators can be used to determine insulin doses based on the current glucose level, a treatment target, the insulin sensitivity factor and the amount of remaining insulin from previous injections. In these systems, the user may select the insulin sensitivity factor, e.g. by the method presented in equations 1 to 14, as well as the duration of the insulin action.

According another aspect of the disclosure, a computer implemented method for managing blood glucose is provided. The method comprises the step of estimating the required insulin dosage needed, during different time intervals, to achieve normoglycemia. The computer implemented method further comprising the step of calculating the sensitivity factor of the drug according to Eq. (6) and the shape and duration of the drug action according to Eq. (7). Finally, comprising the step of calculating a dose according to Eq. (8) and (9) based on the sensitivity factor, the shape and duration of the drug action, information about previous doses, the current biomarker level and target biomarker level.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” “comprising,” “includes” and/or “including” when used herein, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms used herein should be interpreted as having a meaning that is consistent with their meaning in the context of this specification and the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.

The foregoing has described the principles, preferred embodiments and modes of operation of the present invention. However, the invention should be regarded as illustrative rather than restrictive, and not as being limited to the particular embodiments discussed above. The different features of the various embodiments of the invention can be combined in other combinations than those explicitly described. It should therefore be appreciated that variations may be made in those embodiments by those skilled in the art without departing from the scope of the present invention as defined by the following claims.

This model according to Eq (1) can be extended with another FIR model, which represents the net glucose-elevating effect, the meal impact, following a meal. By incorporating the insulin gain λ, the glucose dynamics at time point t_(k), during meal instance j, may then be described as:

$\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{14mu} {t_{k} \in T_{j}}} & (15) \end{matrix}$

where I(t_(k)) represents the insulin infusion, M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r, and y(t_(k)) is the glucose level at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j. The meal impact parameters b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] are fixed for each recipe. In order to fulfill physiologically qualitatively correct responses, constraints were imposed on the FIR parameters. Just as the parameters of the insulin action FIR were restricted to non-positive numbers, the parameters of the meal impact model were restricted to non-negative numbers. A recipe is a unique combination of ingredients, and may denote a single ingredient. Also note that the recipes are specific to an individual (i.e., two persons eating a banana constitutes two different recipes). The net basal endogenous glucose production G_(b) and the insulin multipliers are allowed to vary between different meal instances to capture variations in insulin sensitivity. The insulin action model was considered fixed with the parameter values given by the estimation of that model. To estimate b^(r), G_(b)=[G_(b) ⁽¹⁾ . . . G_(b) ^((N))] and λ=[λ⁽¹⁾ . . . λ^((N))] for N number of meal instances, a maximum-likelihood approach is considered. The total likelihood for the entire dataset from all the meal instances is:

p(Y,I,M _(r) ,G _(b) ,λ,b)∝p(Y|G _(b) ,λ,b)·p(G _(b),λ)·p(b)  (16)

where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances. We would like to maximize this in order to retrieve our parameter estimates. Different priors may be utilized as deemed appropriate. One method among others, a Gibbs sampler, where samples are drawn in an iterative scheme from the conditional distributions may be used to retrieve the parameter estimates:

(G _(b),λ)^((k)) ˜p(G _(b) ,λ|Y,b ^((k−1)))

b _(i) ^((k)) ˜p(b _(i) |Y,b _(¬i) ^((k)),(G _(b),λ)^((k))), ∀b _(i) ∈b  (17)

where k is the sampling index and b_(¬i) ^((k)) is the meal impact vector without term b_(i). When a sufficient number of samples have been collected the expected values can be retrieved. A suitable number of iterations may be determined by someone skilled in the art. The samples are restricted to positive numbers to fulfill the physiological constraints. Using the augmented model, the glucose may be predicted, using the same notation as in Eq (10-12, 15):

$\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{m_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},\mspace{14mu} {1 \leq j \leq p}} & (20) \end{matrix}$

Likewise, Eq (13-14) may be updated with the augmented model according to Eq (15) to recommend doses. 

1. A method for determining a personalized estimate, the magnitude of an intended medical effect, a duration and a shape of this, for a drug, based on sections of data where a target biomarker and dose history have been recorded, wherein the personalized estimate of a finite impulse response model a=[a₀, a₂ . . . a_(n)] and the basal hepatic glucose production G_(b) is determined according to: $\begin{matrix} {{{y\left( t_{k\;} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\; {t_{k} \in T_{j}}} & (1) \end{matrix}$ I(t_(k)) represents a drug infusion and y(t_(k))^((j)) is a biomarker level at a time sample t_(k), v(t_(k))˜N(0, σ_(v)) corresponds to a process noise perturbation with variance σ_(v) ², and T_(j) represents the time instances in a dataset j, and where impulse-response model parameters a=[a₀, a₁ . . . a_(n)] have a biomarker dependence; for each biomarker level G of interest, the following problem is solved to retrieve the parameter estimates; a and G_(b)=[G_(b) ⁽¹⁾ . . . G_(b) ^((N))] using N periods of data: $\begin{matrix} {\left\{ {{a(G)},G_{b}} \right\} = {{\arg \; \min \; {\sum\limits_{j = 1}^{N}\left( {{{y^{(j)} - {\hat{y}}^{(j)}}}_{W^{G}} + {\alpha {a}_{R}} + {\beta {{G_{b}^{(j)} - G_{b}^{0}}}_{2}}} \right)}} + {\gamma {a}_{1}}}} & (2) \end{matrix}$ subject to a _(k)≤0, k=[1, . . . ,n−1] a ₀=0 a _(n)=0  (3) and wherein a second-order regularization matrix R is populated as follows: R(j,j−1:j+1)=[1−21], j=[1, . . . ,n]  (4) wherein y^((j))=[y_(t) _(l) _(j) . . . y_(t) _(n) _(j) ] is the collected biomarker data for data record j covering sample times T_(j)=[t_(l) ^(j) . . . t_(n) ^(j)], and ŷ^((j))=[ŷ_(t) _(l) _(j) . . . ŷ_(t) _(n) _(j) ] is the corresponding estimate of biomarker level according to the equation (1); W^(G) is the quadratic kernel matrix defining the weight of each biomarker measurement according to the distance to the biomarker level G; G_(b) ⁰ is the prior expected value estimate of G_(b), and α, β and γ are penalty terms.
 2. The method according to claim 1, further comprising a step of estimating a required dosage needed, during different time intervals, to achieve an intended effect of the drug on the biomarker.
 3. The method according to claim 1, further comprising a step of calculating the sensitivity factor of the drug for different glucose values G by summing up all the a(G)=[a₀,(G) a₁ (G) . . . a_(n)(G)] terms given by the method according to claim
 1. 4. The method according to claim 3, further comprising calculating an average sensitivity factor of the drug by averaging the sensitivity factors of claim
 3. 5. The method according to claim 4, further comprising a step of calculating a drug dose based on the sensitivity factor, the shape and duration of the drug action, information about previous doses Dj at times Tj, the current biomarker level G and target biomarker level G_(t) according to: $\begin{matrix} {D = {\max \left( {0,\frac{G - G_{t} - {{\overset{\_}{K}}_{ISR} \cdot D_{IOB}}}{{\overset{\_}{K}}_{ISR}}} \right)}} & (8) \\ {and} & \mspace{11mu} \\ {{D_{IOB} = {\sum\limits_{j = 1}^{m}{D_{j}\left( {1 - \frac{\sum\limits_{i = 1}^{{({T - T_{j}})}/5}{\overset{\_}{a}}_{i}}{K_{ISR}}} \right)}}},\mspace{14mu} {\forall{{j\text{:}T_{j}} \leq {T - {5 \cdot n}}}}} & (9) \end{matrix}$
 6. The method according to claim 1, comprising the steps of using the parameters estimated according to claim 1 together with information of the planned dosage and measurements of the biomarker, for calculating an expected effect for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (10) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq p}} & (12) \end{matrix}$ where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, and α is the Kalman filter constant, and I(t_(k)) is the insulin dose at time t_(k); and to issue at least one alarm in an electronic device when predefined thresholds are broken.
 7. The method according to claim 1, comprising the steps of using the parameters estimated according to claim 1 and measurements of the biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (10) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq p}} & (12) \end{matrix}$ where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, and I(t_(k)) is the insulin dose at time t_(k) and α is the Kalman filter constant.
 8. The method according to claim 1, comprising the steps of using the parameters estimated according to claim 1 and measurements of the biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (10) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (11) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\hat{G}}_{b,T}}},\mspace{79mu} {1 \leq j \leq p}} & (12) \end{matrix}$ where ŷ_(t) _(k) _(|t) _(k) is the measurement update, ŷ_(t) _(k+1) _(|t) _(k) is the time update, and ŷ_(t) _(k+j+1) _(|t) _(k+j) is the predicted value one step ahead, I(t_(k)) is the insulin dose at time t_(k), and α is the Kalman filter constant; and for optimizing a therapy, where I_(S)=[I_(T) . . . I_(T+L)] is the suggested insulin dose at the time point of calculation (sample number T) and L (≤p) samples ahead according to: $\begin{matrix} {\min\limits_{I_{S}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$ subject to ŷ _(j)=γ_(low) , j=[T . . . T+L]  (14) where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L)]^(T) is the simulated biomarker trace calculated according to the equations (10)-(12), Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).
 9. The method according to claim 1, comprising the steps of using the parameters estimated according to claim 1 with information about the planned dosage and measurements of the biomarker, for calculating an expected effect and for reprogramming planned doses in a drug delivery pump when predefined thresholds are broken, wherein the new reprogramming dose I_(S)=[I_(T) . . . I_(T+L)] at the time point of calculation (sample number T) and L(≤p) samples ahead is based on an optimization according to: $\begin{matrix} {\min\limits_{I_{S}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$ subject to ŷ _(j)=γ_(low) , j=[T . . . T+L]  (14) where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L)]^(T) is the simulated biomarker according to Eq (10-12) trace, Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).
 10. A method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j.
 11. Using the parameters estimated according to claim 1 and a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾ ₊ . . . y_(n) ⁽¹⁾ ₊ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j, together with information of the planned dosage and measurements of biomarker, for calculating the expected effect for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},\mspace{14mu} {1 \leq j \leq p}} & (20) \end{matrix}$ and to issue at least one alarm in an electronic device when predefined thresholds are broken.
 12. Using the parameters estimated according to claim 1 and a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j, and measurements of biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},\mspace{14mu} {1 \leq j \leq p}} & (20) \end{matrix}$
 13. Using the parameters estimated according to claim 1, and a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j, and recent measurements of biomarker for simulating the effect of different dosage alternatives for a time period covering p sample steps ahead according to: $\begin{matrix} {\mspace{79mu} {{\hat{y}}_{t_{k}t_{k}} = {{\left( {1 - \alpha} \right){\hat{y}}_{t_{k}t_{k - 1}}} + {\alpha \; y_{t}}}}} & (18) \\ {\mspace{79mu} {{\hat{y}}_{t_{k + 1}t_{k}} = {{\hat{y}}_{t_{k}t_{k}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)} \right)}{I\left( t_{k - i} \right)}}} + {\hat{G}}_{b,T}}}} & (19) \\ {{{\hat{y}}_{t_{k + j + 1}t_{k + j}} = {{\hat{y}}_{t_{k + j}t_{k + j - 1}} + {\sum\limits_{i = 0}^{n}{{a_{i}\left( {\hat{y}}_{t_{k + j}t_{k + j - 1}} \right)}{I\left( t_{k + j - i} \right)}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + {\hat{G}}_{b,T}}},\mspace{14mu} {1 \leq j \leq p}} & (20) \end{matrix}$ and for optimizing a therapy I_(S)=[I_(T) . . . I_(T+L)] at the time point of calculation (sample number T) and L(≤p) samples ahead according to: $\begin{matrix} {\min\limits_{I_{S}}{C\left( {\hat{Y} - Y_{R}} \right)}} & (13) \end{matrix}$ subject to ŷ _(j)=γ_(low) , j=[T . . . T+L]  (14) where C is a convex cost function, Ŷ=[ŷ_(T) . . . ŷ_(T+L]) ^(T) is the simulated biomarker according to Eq (10-12) trace, Y_(R)=[y_(R) . . . y_(R)] is a vector the same size as Ŷ of the target biomarker value y_(R).
 14. A system for controlling insulin delivery to a patient according to the method of claim 1, and according to a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance α_(v) ², and T_(j) represents the time instances in dataset j, where the measured biomarker is glucose.
 15. The system according to claim 14, wherein said system comprise an insulin pump, a glucose meter, a receiver unit for a continuous glucose meter, a smartphone, a tablet, a computer or any other device that may have the capability to display information to a user and perform the necessary measurements and calculations.
 16. A medical device performing the calculations according to the method of claim 1, and according to a method for determining a personalized estimate of finite impulse response model b^(r)=[b^(r) ₁, b^(r) ₂ . . . b^(r) _(n)] of a biomarker elevating effect of a meal intake of recipe r, according to a maximum likelihood approach where the total likelihood is maximized: max_(b,λ) ^(p(Y,I,M) ^(r) ^(,G) ^(b) ^(,λ,b)∝p(Y|G) ^(b) ^(,λ,b)·p(G) ^(b) ^(,λ)·p(b))  (15) and where Y=[y₁ ⁽¹⁾_ . . . y_(n) ⁽¹⁾_ . . . y₁ ^((N))_y_(n) ^((N))] is the concatenated glucose reference for all meal instances, calculated according to $\begin{matrix} {{{y\left( t_{k} \right)}^{(j)} = {{y\left( t_{k - 1} \right)}^{(j)} + {\lambda_{j}{\sum\limits_{i = 0}^{n}{{a_{i}\left( {y\left( t_{k} \right)}^{(j)} \right)}{I\left( t_{k - i} \right)}}}} + {\sum\limits_{r = 1}^{R}{\sum\limits_{i = 0}^{m}{b_{i}^{r}{M_{r}^{(j)}\left( t_{k - i} \right)}}}} + G_{b}^{(j)} + {v\left( t_{k} \right)}}},\mspace{11mu} {t_{k} \in T_{j}}} & (16) \end{matrix}$ where I(t_(k)) represents the drug infusion at time t_(k), M_(r)(t_(k)) is the meal intake in grams of carbohydrates in recipe r at time sample t_(k), v(t_(k))˜N(0,σ_(v)) corresponds to a process noise perturbation, with variance σ_(v) ², and T_(j) represents the time instances in dataset j. 